<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>echarts-java</title>
<script src="js/echarts.js"  th:src="@{/js/echarts.js}"></script>
<script src="js/jquery-1.8.3.min.js" th:src="@{/js/jquery-1.8.3.min.js}"></script>

</head>
<body>
	<div id="main" style="width: 600px;height:400px;"></div>
	<script type="text/javascript">
		$(function(){
			var myECharys = echarts.init(document.getElementById("main"));
			alert(1)
			myECharys.clear();
			myECharys.showLoading({text: '正在努力的读取数据中...'});
			$.getJSON('/echarys/t4', function (data) {
				myECharys.setOption(data);
				myECharys.hideLoading();
	        });
			var myVar=setInterval(function(){
				$.post("/echarys/t4",function(data){
					myECharys.clear();
					myECharys.showLoading({text: '正在努力的读取数据中...'});
					myECharys.setOption(data);
					myECharys.hideLoading();
				},"json")
			},5000); 
		})
	</script>
</body>
</html>